<template>
    <div class="home-slider">
      <Slider :items="items" class="slider"></Slider>
      <div class="list">
        <div class="item" v-for="item in enters" :key="item.imgUrl">
          <router-link :to="{name:item.href}">
            <img :src="item.imgUrl" alt="item.title">
            <h4>{{item.title}}</h4>
          </router-link>
        </div>
      </div>
    </div>
</template>

<script>
import Slider from '../core/slider'
export default {
  name: 'homeSlider',
  components: {
    Slider
  },
  data () {
    return {
      items: [{href: 'home', imgUrl: 'https://img12.360buyimg.com/jrpmobile/jfs/t1/4093/36/6284/46179/5ba222d4Ef6991e80/fcd0a90a6863602f.jpg?width=750&height=320'},
        {href: 'home', imgUrl: 'https://img12.360buyimg.com/jrpmobile/jfs/t1/2790/15/6365/41512/5ba22351E6a312896/91ede54780a0ef37.jpg?width=750&height=320'}],
      enters: [
        {
          href: 'download',
          imgUrl: '//img12.360buyimg.com/jrpmobile/jfs/t3991/64/2521945388/12110/93c0139/58d1e462Ncf294123.png?width=132&height=132',
          title: '优惠券'},
        {
          href: 'home',
          imgUrl: '//img12.360buyimg.com/jrpmobile/jfs/t5590/252/875247023/17343/946aa72c/59224650N0f7ffc92.png?width=132&height=132',
          title: '领福利'},
        {
          href: 'home',
          imgUrl: '//img12.360buyimg.com/jrpmobile/jfs/t4393/329/2180608902/13217/c88c0cec/58ec9dcdN1534e2d7.png?width=132&height=132',
          title: '抢钢镚'},
        {
          href: 'home',
          imgUrl: '//img12.360buyimg.com/jrpmobile/jfs/t5488/298/1036263348/12073/b4f4de97/590ac8e8Ne9def22e.png?width=135&height=135',
          title: '白条提额'},
        {
          href: 'home',
          imgUrl: '//img12.360buyimg.com/jrpmobile/jfs/t1/520/34/950/3686/5b9239e3Eaaf5465c/8d8c35badacfc114.png?width=90&height=90',
          title: '工资理财'}]
    }
  }
}
</script>

<style lang="stylus" scoped>
  .home-slider
   margin-top:1.2rem
   .slider
    height:0
    overflow:hidden
    background:#eaeaea
    width:100%
    padding-bottom:43%
   .list
    height:0
    width: 100%
    padding-bottom:25%
    overflow:hidden
    display:flex
    .item
     width:20%
     height:1.8rem
     box-sizing:border-box
     padding:.1rem
     text-align:center
     img
      width:100%
     a
      text-decoration:none
      color:#666
      font-size:.24rem
</style>
